import { HashMap } from "../../api/struct/HashMap";
import { CDEquipment } from "../excel/CDEquipment";
import { CDEquipmentRune } from "../excel/CDEquipmentRune";

/**
 * 扩展-符文
 */
export abstract class CEEquipmentRune {

    /**数据-可替换套装成员的符文组 */
    public static suitRuneMap = new HashMap<number, number[]>();

    /**初始化 */
    public static init(): void {
        const vs = CDEquipmentRune.datas.getValues();
        for (let i = 0, len = vs.length; i < len; i++) {
            if (vs[i].equipment === 0) {
                continue;
            }
            const equipConfig = CDEquipment.getData(vs[i].equipment);
            if (!equipConfig || equipConfig.suit === 0) {
                continue;
            }

            let list = this.suitRuneMap.get(equipConfig.suit);
            if (!list) {
                list = [];
                this.suitRuneMap.put(equipConfig.suit, list);
            }
            list.push(vs[i].id);
        }
    }
}
